package org.jeecg.modules.demo.annualkeywork.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.demo.annualkeywork.entity.KeyWorkDepartments;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.annualkeywork.entity.ReportAnnualKeyWork;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description: 重点工作配合部门
 * @Author: jeecg-boot
 * @Date:   2025-08-19
 * @Version: V1.0
 */
@Mapper
public interface KeyWorkDepartmentsMapper extends BaseMapper<KeyWorkDepartments> {

	/**
	 * 通过主表id删除子表数据
	 *
	 * @param mainId 主表id
	 * @return boolean
	 */
    boolean deleteByMainId(@Param("mainId") String mainId);

  /**
   * 通过主表id查询子表数据
   *
   * @param mainId 主表id
   * @return List<KeyWorkDepartments>
   */
  List<KeyWorkDepartments> selectByMainId(@Param("mainId") String mainId);
//	获取子表的所有数据
	List<KeyWorkDepartments> getAllList();
//	根据主表id获取子表中的完成进度数据
	List<String> SelectCompletionProgress(String id);
//	保存汇报年度重点工作
	int saveReport(@RequestParam ReportAnnualKeyWork reportAnnualKeyWork);
//	查找已汇报的重点工作数据
	List<KeyWorkDepartments> SelectFinishedReportAnnualKeyWork();
//	根据子表的id更新任务状态为待审批
	int updateTaskstatusByKid(@RequestParam String id);
}
